import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

/**
 * Created by Administrator on 2018/5/26.
 */

    @WebServlet(name = "deleteServlet")
    public class deleteServlet extends HttpServlet {
        protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
            this.doGet(request,response);
        }

        protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, UnsupportedEncodingException {
            request.setCharacterEncoding("UTF-8");
            response.setCharacterEncoding("UTF-8");
            response.setContentType("text/html;charset=UTF-8");
            String id=request.getParameter("id");
            PrintWriter out=response.getWriter();
            out.println("<html>");
            out.println("<head><title></head></title>");
            out.println("<body>");
            out.println("<h1><a href=\"userList\">返回列表</a></h1>");
            out.println("</body>");
            out.println("</html>");
            out.close();
            DeleteDataBase deleteDataBase=new DeleteDataBase();
            deleteDataBase.setId(id);
            deleteDataBase.deleteData();
        }
    }

